import 'package:flutter/material.dart';
import 'package:hkzf/pages/home/tab_search/filter_bar/index.dart';
import 'package:hkzf/widgets/room_list_item_widget.dart';
import 'package:hkzf/widgets/seach_bar/index.dart';

import 'dataList.dart';
import 'filter_bar/filter_drawer.dart';

class TabSearch extends StatefulWidget {
  TabSearch({Key key}) : super(key: key);
  TabSearch.onst({Key key}) : super(key: key);

  @override
  _TabSearchState createState() => _TabSearchState();
}

class _TabSearchState extends State<TabSearch> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      endDrawer: FilterDarwer(),
      appBar: AppBar(
        actions: [Container()],
        elevation: 0,
        title: SearchBar(
          showLoaction: true,
          showMap: true,
          onSearch: () {
            Navigator.pushNamed(context, '/search');
          },
        ),
        backgroundColor: Colors.white,
      ),
      body: Column(
        children: [
          FilterBar(
            onchange: (val) {},
          ),
          Expanded(
            child: ListView(
              children: dataList
                  .map(((item) => RoomListItemWidget(data: item)))
                  .toList(),
            ),
          )
        ],
      ),
    );
  }
}
